export async function bar() {
  const promise = new Promise<string>(resolve => {
    resolve('value');
    return 'finish';
  });
  await promise;

  Promise.reject('value').catch(() => {
    console.error('error');
  });

  await Promise.reject('value').finally(() => {
    console.info('finally');
  });

  await Promise.all(['1', '2', '3'].map(x => x + '1'));
}

const promise = new Promise((resolve, reject) => resolve('value'));
await promise;

async function returnsPromise() {
  return 'value';
}
returnsPromise().then(
  () => {},
  () => {},
);

Promise.reject('value').catch(() => {});

await Promise.reject('value').finally(() => {});

await Promise.all([1, 2, 3].map(async x => x + 1));